﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="car-quote.aspx.cs" Inherits="car_quote"
    MasterPageFile="~/Mobile.master" Async="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc2" %>
<%@ Register Src="~/controls/usrGender.ascx" TagName="usrGender" TagPrefix="uc3" %>
<%@ Register Src="~/controls/usrMaritalStatus.ascx" TagName="usrMaritalStatus" TagPrefix="uc4" %>
<%@ Register Src="~/controls/usrOccupation.ascx" TagName="usrOccupation" TagPrefix="uc5" %>
<%@ Register Src="~/controls/usrJobNature.ascx" TagName="usrJobNature" TagPrefix="uc7" %>
<%@ Register Src="~/controls/usrPhoneNo.ascx" TagName="usrPhoneNo" TagPrefix="uc10" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form id="Form1" runat="server">
    <section>
        <header id="header">
            <nav id="nav">
                <a href="default.aspx">
                    <div class="branding">
                    </div>
                </a>
                <div class="navpages">
                    <a href="default.aspx">
                        <asp:Image ID="imgTop" runat="server" ImageUrl="images/button/topnav-back.png" Width="49"
                            Height="29" border="0" alt="back" BorderWidth="0" /></a>
                </div>
            </nav>
        </header>
    </section>
    <section id="body">
        <div class="body">
            <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
            </asp:ScriptManager>
            <%--<h1>Free Car Insurance Quote</h1>--%>
            <br />
            <div class="form">
                <div class="top">
                </div>
                <div class="body">
                    <div class="pad">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="cardetail"
                            ShowSummary="True" CssClass="errorSummary"></asp:ValidationSummary>
                        <asp:Label ID="lblPolicyId" runat="server"></asp:Label>
                        <asp:Label ID="Label4" runat="server"></asp:Label>
                        <div>
                            <span style="float: right; font-size: 12px; padding-top: 5px;">
                                <asp:HyperLink ID="hplLogin" NavigateUrl="login.aspx" runat="server"> &raquo; sign in to view your previous quotes </asp:HyperLink>
                                <asp:HyperLink ID="hplViewSavedQuotes" NavigateUrl="user/ViewResultHistory.aspx" runat="server"> &raquo; view previous quotes </asp:HyperLink>
                                <br />
                            </span>
                        </div>
                        <div class="section">
                            <div class="seperator">
                            </div>
                            <asp:UpdateProgress runat="server" ID="updPgrDriver">
                                <ProgressTemplate>
                                    <div style="position: absolute; width: 250px; height: 1050px; background-color: Gray;
                                        filter: alpha(opacity=90); opacity: 0.8;">
                                        <img alt="" src="images/loader/small_loading.gif" style="margin-top: 120px;" />
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <asp:Label runat="server" ID="lblAgentHeader" Text="" />
                            <asp:Label ID="lblCarId" runat="server"></asp:Label>
                            <asp:Label ID="lblGUID" runat="server"></asp:Label>
                            <h1>
                            </h1>
                            <div>
                                <asp:ValidationSummary ID="vsCarDetail" runat="server" ValidationGroup="cardetail"
                                    ShowSummary="True" HeaderText="Oops... Please complete the highlighted field"
                                    CssClass="errorSummary" style="padding-top: 10px;"/>
                                <asp:Label ID="Label5" runat="server"></asp:Label>
                            </div>
                            <asp:DropDownList ID="ddlManufactYear" runat="server" Width="233px" CssClass="input">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvManufactYear"
                                ControlToValidate="ddlManufactYear" InitialValue="-1" runat="server" ErrorMessage=""
                                Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                            <div class="row_curved" id="divRegYear" runat="server" style="display: none">
                                <asp:DropDownList ID="ddlRegYear" Width="233px" runat="server" CssClass="input">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator Enabled="false" Display="Dynamic" CssClass="validationErrorControl"
                                    ControlToValidate="ddlRegYear" InitialValue="-1" runat="server" ID="rfvRegYear"
                                    ErrorMessage="" Text="" ValidationGroup="cardetail">
                                </asp:RequiredFieldValidator>
                                <asp:CompareValidator Enabled="false" CssClass="validationErrorControl" ID="cpvRegYear"
                                    runat="server" ControlToCompare="ddlRegYear" ControlToValidate="ddlManufactYear"
                                    Operator="LessThan" ErrorMessage="" Text="" ValidationGroup="cardetail" Type="Integer"></asp:CompareValidator>
                            </div>
                            <div id="divCarInfo">
                                <div class="row_curved">
                                    <div class="field_new">
                                        <asp:UpdatePanel runat="server" ID="uplCarMakeModel">
                                            <ContentTemplate>
                                                <span class="indicator">
                                                    <asp:DropDownList ID="ddlCarMake" runat="server" Width="233px" AutoPostBack="True"
                                                        OnSelectedIndexChanged="ddlCarMake_SelectedIndexChanged" CssClass="input">
                                                        <asp:ListItem Text="Select" Value="-1"></asp:ListItem>
                                                    </asp:DropDownList>
                                                    <asp:DropDownList ID="ddlCarModel" Width="233px" runat="server" CssClass="input">
                                                        <asp:ListItem Text="Select" Value="-1"></asp:ListItem>
                                                    </asp:DropDownList>
                                                    <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCarMake" ControlToValidate="ddlCarMake"
                                                        InitialValue="-1" runat="server" ErrorMessage="" Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                                    <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCarModel" ControlToValidate="ddlCarModel"
                                                        InitialValue="-1" runat="server" ErrorMessage="" Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                                </span>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" style="display: none">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <asp:UpdatePanel runat="server" ID="uplCheckCustomCarMakeModel">
                                            <ContentTemplate>
                                                <asp:CheckBox ID="chkCannotfind" AutoPostBack="true" runat="server" Text="" OnCheckedChanged="chkCannotfind_CheckedChanged" />
                                                <span>Can’t find your make/model</span>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <asp:UpdatePanel runat="server" ID="uplCustomCarMakeModel">
                                    <ContentTemplate>
                                        <div runat="server" class="row_curved" id="divCarMakeModel" visible="false">
                                            <label class="mand_red">
                                                Your Car Make &amp; Model</label>
                                            <div class="field">
                                                <span class="indicator">
                                                    <asp:TextBox ID="txtCustomCarMakeModel" Text="" runat="server" Width="350px" MaxLength="80"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rfvCustomCarMakeModel" runat="server" CssClass="validationErrorControl"
                                                        Display="Dynamic" ErrorMessage="" ControlToValidate="txtCustomCarMakeModel" ValidationGroup="cardetail"
                                                        Text=""></asp:RequiredFieldValidator>
                                                </span>
                                            </div>
                                            <div class="clear">
                                            </div>
                                        </div>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                            <%--<div class="field">
                                    <span><a href="https://www.psi.gov.sg/NASApp/tmf/TMFServlet?app=SPF-PTD-EDDIES-II"
                                        target="_blank" title="Check Eligibility" style="font-size: 9px; padding-left: 2px;
                                        width: 80px;">Check Eligibility</a> </span>
                                    
                            </div>--%>
                            
                            
                            <asp:UpdatePanel ID="updDriver" EnableViewState="true" runat="server">
                                <ContentTemplate>
                                    <div class="row_curved">
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:DropDownList runat="server" AutoPostBack="true" ID="ddlAddDriver" Width="233px"
                                                    OnSelectedIndexChanged="ddlAddDriver_SelectedIndexChanged" CssClass="input" Visible="false">
                                                    <asp:ListItem Text="- add additional name driver? -" Value="-1">
                                                    </asp:ListItem>
                                                    <asp:ListItem Text="Yes" Value="1">
                                                    </asp:ListItem>
                                                    <asp:ListItem Text="No" Value="0" Selected="True">
                                                    </asp:ListItem>
                                                </asp:DropDownList>
                                            </span>
                                            <%--<div class="radiol" id="divYesAddDriver">
                                            <span class="indicator">
                                                <asp:RadioButton AutoPostBack="true" ID="rdoYesAddDriver" CausesValidation="false"
                                                    runat="server" GroupName="adddriver" OnCheckedChanged="rdoYesAddDriver_CheckedChanged" />
                                                <span class="radioalign">
                                                    <asp:Label ID="lblYesAddDriver" runat="server" Text="Yes"></asp:Label></span>
                                            </span>
                                        </div>
                                        <div class="radior" id="divNoAddDriver">
                                            <span class="indicator">
                                                <asp:RadioButton AutoPostBack="true" ID="rdoNoAddDriver" CausesValidation="false"
                                                    runat="server" GroupName="adddriver" OnCheckedChanged="rdoNoAddDriver_CheckedChanged" />
                                                <span class="radioalign">
                                                    <asp:Label ID="lblNoAddDriver" runat="server" Text="No"></asp:Label></span>
                                            </span>
                                        </div>--%>
                                            <%--<br />
                                        <span style="font-size:x-small;">(not including yourself)</span>--%>
                                            <%--<div style="display: none">
                                            <asp:TextBox ID="txtAddDriver" runat="server"></asp:TextBox>
                                        </div>--%>
                                            <%-- <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvAddDriver" runat="server"
                                            ControlToValidate="ddlAddDriver" ErrorMessage="" ValidationGroup="cardetail"
                                            InitialValue="-1" Display="Dynamic"></asp:RequiredFieldValidator>--%>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div id="divAddDriver" runat="server" visible="false">
                                        <div class="row_curved">
                                            <span class="indicator">
                                                <asp:DropDownList CausesValidation="false" AutoPostBack="true" ID="ddlDriverCount"
                                                    CssClass="input" runat="server" Width="233px" OnSelectedIndexChanged="ddlDriverCount_SelectedIndexChanged">
                                                    <asp:ListItem Text="- number of additional driver/s? -" Value="-1"></asp:ListItem>
                                                    <asp:ListItem>1</asp:ListItem>
                                                    <asp:ListItem>2</asp:ListItem>
                                                </asp:DropDownList>
                                            </span><span class="indicator">
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvNoOfDriver"
                                                    runat="server" ControlToValidate="ddlDriverCount" InitialValue="-1" ErrorMessage=""
                                                    ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                            </span>
                                        </div>
                                        <%-- <div class="row_curved">
                                        <asp:Panel ID="pnlDriver" runat="server" Width="100%">
                                            <div id="divDriver1" runat="server" visible="false">
                                                <uc4:usrCarDriver ID="UsrCarDriver1" runat="server" DriverNo="1" ValidationGroup="cardetail"
                                                    IsEnabled="true" />
                                                <br />
                                            </div>
                                            <div id="divDriver2" runat="server" visible="false">
                                                <uc4:usrCarDriver ID="UsrCarDriver2" runat="server" DriverNo="2" ValidationGroup="cardetail"
                                                    IsEnabled="true" />
                                                <br />
                                            </div>
                                            <div id="divDriver3" runat="server" visible="false">
                                                <uc4:usrCarDriver ID="UsrCarDriver3" runat="server" DriverNo="3" ValidationGroup="cardetail"
                                                    IsEnabled="true" />
                                                <br />
                                            </div>
                                            <div id="divDriver4" runat="server" visible="false">
                                                <uc4:usrCarDriver ID="UsrCarDriver4" runat="server" DriverNo="4" ValidationGroup="cardetail"
                                                    IsEnabled="true" />
                                                <br />
                                            </div>
                                            <div id="divDriver5" runat="server" visible="false">
                                                <uc4:usrCarDriver ID="UsrCarDriver5" runat="server" DriverNo="5" ValidationGroup="cardetail"
                                                    IsEnabled="true" />
                                                <br />
                                            </div>
                                        </asp:Panel>
                                    </div>--%>
                                    </div>
                                    <div>
                                        <asp:Label ID="Label6" runat="server" Font-Bold="True" ForeColor="#4d485b"></asp:Label>
                                        <div style="display: none">
                                            <asp:TextBox ID="txtDriverValid" runat="server">Valid</asp:TextBox>
                                            <asp:CustomValidator ID="csvDriver" runat="server" ClientValidationFunction="DriverFieldValidate"
                                                OnServerValidate="DriverFieldValidate" ControlToValidate="txtDriverValid" ErrorMessage="Driver fields are not valid."
                                                ValidationGroup="cardetail" Text=""></asp:CustomValidator>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <div class="row_curved">
                                <span class="indicator">
                                    <asp:DropDownList ID="ddlCoverageComDate" onchange="GetCoverageEndDate()" runat="server"
                                        Width="233px" CssClass="input">
                                    </asp:DropDownList>
                                </span><span style="font-size: x-small;">Expiry Date :
                                    <asp:Label runat="server" ID="lblCoverageExpireDate" Text="" /></span> <span class="indicator">
                                        <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCoverComDate"
                                            runat="server" InitialValue="-1" ControlToValidate="ddlCoverageComDate" ErrorMessage=""
                                            ValidationGroup="cardetail" Display="Dynamic"></asp:RequiredFieldValidator>
                                    </span>
                            </div>
                            <div id="divInsuranceCompany" style="display: none;">
                                <span class="indicator">
                                    <asp:DropDownList ID="ddlCurInsuranceCompany" Width="233px" runat="server" CssClass="input">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="rfvCurInsuranceCompany" ControlToValidate="ddlCurInsuranceCompany"
                                        CssClass="validationErrorControl" runat="server" InitialValue="-1" ValidationGroup="cardetail"
                                        Text="" ErrorMessage="" Enabled="false"></asp:RequiredFieldValidator>
                                </span>
                            </div>
                            <asp:TextBox ID="txtFirstName" Width="233" MaxLength="50" runat="server" Text="Your Given Name"
                                CssClass="input"></asp:TextBox>
                            <asp:TextBox ID="txtSurName" Width="233" MaxLength="50" runat="server" Text="Your Surname"
                                CssClass="input"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" CssClass="validationErrorControl"
                                ValidationGroup="cardetail" ErrorMessage="" Text="" ControlToValidate="txtFirstName"
                                InitialValue="Your Given Name" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revFirstName" runat="server" ValidationGroup="cardetail"
                                ValidationExpression="^[a-zA-Z''-'\s]{1,50}$" CssClass="validationErrorControl"
                                ControlToValidate="txtFirstName" ErrorMessage="" Display="Dynamic"></asp:RegularExpressionValidator>
                            <asp:RequiredFieldValidator ID="rfvSurName" runat="server" CssClass="validationErrorControl"
                                ValidationGroup="cardetail" ErrorMessage="" Text="" ControlToValidate="txtSurName"
                                InitialValue="Your Surname" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revSurname" runat="server" ValidationGroup="cardetail"
                                ValidationExpression="^[a-zA-Z''-'\s]{1,50}$" CssClass="validationErrorControl"
                                ControlToValidate="txtSurName" ErrorMessage="" Display="Dynamic"></asp:RegularExpressionValidator>
                                <html5:EmailInput ID="txtEmailAddress" runat="server" MaxLength="100" Width="233px" CssClass="input" Text="Your Email">
                                    </html5:EmailInput>
                            <span class="indicator">
                                <asp:RequiredFieldValidator ID="rfvEmail" runat="server" Text="" CssClass="validationErrorControl"
                                    ValidationGroup="cardetail" ErrorMessage="" ControlToValidate="txtEmailAddress"
                                    Display="Dynamic"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="rfvEmailValid" Text="" CssClass="validationErrorControl"
                                    runat="server" ValidationGroup="cardetail" ErrorMessage="" ControlToValidate="txtEmailAddress"
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                                <uc10:usrPhoneNo ID="txtMobileNo" ValidationGroup="cardetail" IsEnabled="true" PhoneNoErrorMessage="Mobile Phone No must be number value."
                                    PhoneNoValidErrorMessage="Mobile phone no is not valid." IsRequired="true" PhoneNoRequireErrorMessage="Require Mobile Phone No."
                                    runat="server" />
                                <asp:Label runat="server" ID="lblHiddenCarId" Visible="false"></asp:Label>
                                <asp:Label runat="server" ID="lblHiddenCarPolicyId" Visible="false"></asp:Label>
                                <div id="divSubmitLoading" style="display: none">
                                    <table style="width: 100%;">
                                        <tr>
                                            <td align="center" valign="middle">
                                                <img src="../images/loading7.gif" id="imgLoading" alt="Loading" width="30" height="20" />
                                                <span id="divLoadingMessage">Please wait...</span>
                                            </td>
                                        </tr>
                                        <tr align="right">
                                            <td>
                                                <a id="lnkStop" href="javascript:StopSubmit();">Cancel</a>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <br />
                                <br />
                                <asp:Button runat="server" ID="btnNext" CssClass="apply" ValidationGroup="cardetail"
                                    OnClientClick="LoadValidationErrorCss();"
                                    OnClick="btnNext_Click" BorderWidth="0" />
                        </div>
                        <div id="divLoggedin" runat="server">
                            <br />
                            <asp:ImageButton ID="imgbtnLogout" runat="server" ImageUrl="~/images/button/logout.png"
                                Visible="false" OnClick="imgbtnLogout_Click" />
                            <hr />
                        </div>
                        <%--<a href="tel:022688222" >
<asp:Image ID="imgCallHotline" runat="server" ImageUrl="~/images/public/hotline_en.png" Width="220" AlternateText="Call us at 02 268 8222" BorderWidth="0" /></a><br />--%>
                    </div>

                    <script type="text/javascript">
        // <![CDATA[
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();
            OnOffUpdateProgress(true);
        }

        function OnOffUpdateProgress(onOff) {
            $get('<%=ddlCarMake.ClientID%>').disabled = onOff;
            $get('<%=ddlCarModel.ClientID%>').disabled = onOff;
            //$get('<=rdoYesClaimLast3Year.ClientID>').disabled = onOff;
            //$get('<=rdoNoClaimLast3Year.ClientID>').disabled = onOff;
            //if ($get('<=rdoYesAddDriver.ClientID>') != null)
            //    $get('<=rdoYesAddDriver.ClientID>').disabled = onOff;
            //if ($get('<=rdoNoAddDriver.ClientID>') != null)
            //    $get('<=rdoNoAddDriver.ClientID>').disabled = onOff;
            //if ($get('<=ddlDriverCount.ClientID>') != null)
            //    $get('<=ddlDriverCount.ClientID>').disabled = onOff;

            JT_init();
        }

        function EndRequest(sender, args) {
            OnOffUpdateProgress(false);
        }

        function GetCoverageEndDate() {
            var _commDate = document.getElementById('<%=ddlCoverageComDate.ClientID%>');
            var _expDate = document.getElementById('<%=lblCoverageExpireDate.ClientID%>');
            var now = new Date();
            var next = new Date();
            var month = new Array(12);
            month[0] = "January";
            month[1] = "February";
            month[2] = "March";
            month[3] = "April";
            month[4] = "May";
            month[5] = "June";
            month[6] = "July";
            month[7] = "August";
            month[8] = "September";
            month[9] = "October";
            month[10] = "November";
            month[11] = "December";
            //alert(_commDate.value);
            var strCommDate = _commDate.value;
            if (strCommDate != "-1") {
                var strDay = strCommDate.substring(0, 2);
                //var strMonth = (parseInt(strCommDate.substring(2, 4)) - 1).toString();
                var strMonth = strCommDate.substring(2, 4) - 1;
                var strYear = strCommDate.substring(4, 8);
                //alert(strYear + "/" + strMonth + "/" + strDay);
                now.setFullYear(strYear, strMonth, strDay);
                next.setFullYear((parseInt(strYear) + 1).toString(), strMonth, (now.getDate() - 1).toString());
                //alert(now);
                //alert(next);
                var strExpiryDate = next.getDate() + "/" + month[next.getMonth()] + "/" + next.getFullYear();
                _expDate.innerHTML = strExpiryDate;
            }
            else {
                _expDate.innerHTML = "";
            }
            //Cover Expiry Date: 22/Mar/2012
        }


        function ShowHideDiv(divName, varOnOff) {
            if (varOnOff) {
                document.getElementById(divName).style.display = "";
            }
            else {
                document.getElementById(divName).style.display = "none";
            }
        }


        function showhide(el) {

            el = document.getElementById(el);
            if (el != null)
                el.style.display = (el.style.display == "none") ? "block" : "none";

        }

        window.onload = function() {
            //showhide('divCarMakeModel');
            //CustomCarMakeModelCheckedChanged();
            OnOffUpdateProgress(false);
        }

        //var CarMakeModel;
        //var ArrCarMakeModel;

        function CheckOffPeakValidationCss() {
            var ctrlDivYes = 'divYesOffPeak';
            var ctrlDivNo = 'divNoOffPeak';
            var txtText = '<=txtOffPeak.ClientID>';
            var valOffPeak = '<=rfvOffPeak.ClientID>';
            ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valOffPeak);
            return true;
        }

        function CheckRegYearValidationCss() {
            var ctrlDivYes = 'divYesRegYear';
            var ctrlDivNo = 'divNoRegYear';
            var txtText = '<=txtRegYear.ClientID>';
            var valOffPeak = '<=rfvCheckRegYear.ClientID>';
            ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valOffPeak);
            return true;
        }


        function CheckRegYear() {
            var ctrlRegYear = document.getElementById('<=txtRegYear.ClientID>');
            var ctrlY = document.getElementById('<=rdoYesRegYear.ClientID>');
            var ctrlN = document.getElementById('<=rdoNoRegYear.ClientID>');
            var valRegYear = document.getElementById('<=rfvCheckRegYear.ClientID>');
            if (ctrlY.checked == true || ctrlN.checked == true) {
                ctrlRegYear.value = '1';
                valRegYear.style.visibility = 'hidden';
            }
            else {
                ctrlRegYear.value = '';
            }
        }


        function CheckOffPeak() {
            //alert('CheckOffPeak');
            var ctrlOffPeak = document.getElementById('<=txtOffPeak.ClientID>');
            var ctrlY = document.getElementById('<=rdoYesOffPeak.ClientID>');
            var ctrlN = document.getElementById('<=rdoNoOffPeak.ClientID>');
            var valOffPeak = document.getElementById('<=rfvOffPeak.ClientID>');
            if (ctrlY.checked == true || ctrlN.checked == true) {
                ctrlOffPeak.value = '1';
                valOffPeak.style.visibility = 'hidden';
            }
            else {
                ctrlOffPeak.value = '';
            }
        }

        //CAR POLICY DETAILS HERE

        function SortByClientValidate(source, arguments) {
            if (arguments.Value == -1) {
                document.getElementById(source.id).selectedIndex = 0;
                arguments.IsValid = false;
            } else {
                arguments.IsValid = true;
            }
        }


        function CheckOffDComValidationCss() {
            var ctrlDivYes = 'divYesOffFDCom';
            var ctrlDivNo = 'divNoOffFDCom';
            var txtText = '<=txtOffenceFree.ClientID>';
            var valCtrl = '<=rfvOffenceFDCom.ClientID>';
            ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
            return true;
        }


        function CheckOffDCom() {
            var ctrlTxt = document.getElementById('<=txtOffenceFree.ClientID>');
            var ctrlY = document.getElementById('<=rdoYesOffFDCom.ClientID>');
            var ctrlN = document.getElementById('<=rdoNoOffFDCom.ClientID>');
            var valCtrl = document.getElementById('<=rfvOffenceFDCom.ClientID>');
            if (ctrlY.checked == true || ctrlN.checked == true) {
                ctrlTxt.value = '1';
                valCtrl.style.visibility = 'hidden';
            }
            else {
                ctrlTxt.value = '';
            }
        }

        function CheckAddDriverValidationCss() {
            var ctrlDivYes = 'divYesAddDriver';
            var ctrlDivNo = 'divNoAddDriver';
            var txtText = '<=txtAddDriver.ClientID>';
            var valCtrl = '<=rfvAddDriver.ClientID>';
            ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
            return true;
        }

        function CheckAddDriver() {
            var ctrlTxt = document.getElementById('<=txtAddDriver.ClientID>');
            var ctrlY = document.getElementById('<=rdoYesAddDriver.ClientID>');
            var ctrlN = document.getElementById('<=rdoNoAddDriver.ClientID>');
            var valCtrl = document.getElementById('<=rfvAddDriver.ClientID>');
            var ddlDrvCount = document.getElementById('<=ddlDriverCount.ClientID>');
            var divAddDriver = document.getElementById('<=divAddDriver.ClientID>');

            if (ctrlY.checked == true || ctrlN.checked == true) {
                ctrlTxt.value = '1';
                valCtrl.style.visibility = 'hidden';
            }
            else {
                ctrlTxt.value = '';
            }

            if (ctrlY.checked == true) {
                if (ddlDrvCount != null) {
                    ddlDrvCount.disabled = false;
                    showhideDriver();
                }
                if (divAddDriver != null) divAddDriver.style.display = '';
            }
            else {
                if (ddlDrvCount != null) {
                    ddlDrvCount.selectedIndex = 0;
                    ddlDrvCount.disabled = true;
                    showhideDriver();
                }
                if (divAddDriver != null) divAddDriver.style.display = 'none';
            }
        }

        function CheckOffFDComValidationCss() {
            var ctrlDivYes = 'divYesOffFDCom';
            var ctrlDivNo = 'divNoOffFDCom';
            var txtText = '<=txtOffenceFree.ClientID>';
            var valCtrl = '<=rfvOffenceFDCom.ClientID>';
            //alert(txtText);
            ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
            return true;
        }

        function CheckOffFDCom() {
            //alert('CheckOffFDCom');
            var ctrlTxt = document.getElementById('<=txtOffenceFree.ClientID>');
            var ctrlY = document.getElementById('<=rdoYesOffFDCom.ClientID>');
            var ctrlN = document.getElementById('<=rdoNoOffFDCom.ClientID>');
            var valCtrl = document.getElementById('<=rfvOffenceFDCom.ClientID>');

            if (ctrlY.checked == true || ctrlN.checked == true) {
                ctrlTxt.value = '1';
                valCtrl.style.visibility = 'hidden';
            }
            else {
                ctrlTxt.value = '';
            }
        }


        function CheckRegistrationYearValidationOLD() {
            var rdoYesRegYear = document.getElementById("<=rdoYesRegYear.ClientID>");
            var rdoNoRegYear = document.getElementById("<=rdoNoRegYear.ClientID>");
            var valCompare = document.getElementById("<=cpvRegYear.ClientID>");
            var valRequire = document.getElementById("<=rfvRegYear.ClientID>");

            if (rdoYesRegYear.checked) {
                ValidatorEnable(valRequire, true);
                ValidatorEnable(valCompare, true);
                document.getElementById('<=divRegYear.ClientID>').style.display = '';
            }
            else {
                ValidatorEnable(valRequire, false);
                ValidatorEnable(valCompare, false);
                document.getElementById('<=divRegYear.ClientID>').style.display = 'none';
            }
        }

        function DriverFieldValidate(source, arguments) {
            var result = true;
            arguments.IsValid = result;
        }


        function DefaultFirstName(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                TextBoxControl.value = "Your Given Name";
            }
        }

        function DefaultSurName(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                TextBoxControl.value = "Your Surname";
            }
        }

        function DefaultEmail(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                TextBoxControl.value = "Your Email";
            }
        }


        function ClearText(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value == "Your Given Name") {
                TextBoxControl.value = "";
            }
            if (TextBoxControl.value == "Your Surname") {
                TextBoxControl.value = "";
            }
            if (TextBoxControl.value == "Your Email") {
                TextBoxControl.value = "";
            }
            if (TextBoxControl.value == "Your Mobile") {
                TextBoxControl.value = "";
            }
        }
//        function ShowHideAll() {
//            try {
//                IncreaseProgress(100);
//                HideLoading();
//            }
//            catch (ex) {
//                alert(ex.name + ' ' + ex.message);
//            }
//        }


        //history.go(+1);
        // ]]>
                    </script>

                    <asp:Label ID="lblMessage" runat="server"></asp:Label>
                    <%--<asp:Button ID="btnApply" runat="server" Width="250" Height="46" BorderWidth="0" ValidationGroup="carquote" OnClientClick="LoadValidationErrorCss()" onclick="btnApply_Click"  CssClass="apply" />--%>
                    <section class="note">
Disclaimer: CompareXpress is an instant financial
comparison engine helping you find the most competitive
offers from a range of financial services providers.
<br />
</section>
                </div>
                <div class="bottom">
                </div>
            </div>
    </section>
    <div id="divPopup">
        <div style="margin: 0 auto; width: 266px; text-align: center; display: none;">
            <asp:ImageButton ID="imgbtnTest" runat="server" ImageUrl="/images/button/reminder_travel_travelpack.png"
                AlternateText="Set Travel Insurance Reminder" />
        </div>
        <cc1:ModalPopupExtender ID="mpePassword" runat="server" TargetControlID="imgbtnTest"
            PopupControlID="pnlPassword" BackgroundCssClass="modalBackground" DropShadow="true"
            BehaviorID="mdlPopupPassword">
        </cc1:ModalPopupExtender>
        <asp:Panel ID="pnlPassword" runat="server" Style="display: none; background-color: White;"
            DefaultButton="btnExUserLogin">
            <asp:UpdatePanel ID="upPassword" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div class="sr_wrapper_travel_new" style="width: 430px; padding: 20px; border: 9px solid #3b3b3b;
                        overflow: visible; height: auto;">
                        <div class="sr_content_travel_3">
                            <div class="sr_form_new">
                                <h1>
                                    Sign in now to save you time from filling up.</h1>
                                <div>
                                    <asp:Label ID="lblAccountMessage" runat="server"></asp:Label>
                                </div>
                                <div class="row pad_10b">
                                    <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="userpassword"
                                        ShowSummary="True" CssClass="errorSummary" HeaderText="Oops... Please complete the form">
                                    </asp:ValidationSummary>
                                </div>
                                <div class="f_row">
                                    <span class="form_l email_ico">Email</span>
                                    <div class="f_field">
                                    <html5:EmailInput ID="txtExEmail" runat="server" MaxLength="100" Width="210px" >
                                    </html5:EmailInput>
                                    </div>
                                    <div class="f_field">
                                        <asp:RequiredFieldValidator ID="rfvExEmail" CssClass="validationErrorControl" runat="server"
                                            ValidationGroup="userpassword" ErrorMessage="" Text="" ControlToValidate="txtExEmail"
                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator CssClass="validationErrorControl" ID="rfvExEmailValid"
                                            runat="server" ValidationGroup="userpassword" ErrorMessage="" Text="" ControlToValidate="txtExEmail"
                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="f_row">
                                    <span class="form_l name_ico">Password</span>
                                    <div class="f_field">
                                        <asp:TextBox ID="txtExAuthCode" MaxLength="20" runat="server" TextMode="Password"
                                            CssClass="form_login" />
                                    </div>
                                    <div class="f_field">
                                        <asp:RequiredFieldValidator ID="rfvExAuthCode" CssClass="validationErrorControl"
                                            runat="server" ValidationGroup="userpassword" ErrorMessage="" Text="" ControlToValidate="txtExAuthCode"
                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                        <asp:Label runat="server" ID="lblEmailMessage" Visible="false" CssClass="validationError"></asp:Label>
                                    </div>
                                    <br />
                                    <br />
                                    <%-- <div class="f_field">
                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/user/PasswordRecovery.aspx">Forgotten your password?</asp:HyperLink>
                                    </div>--%>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="f_row">
                                    <asp:Label ID="Label1" runat="server" CssClass="assumption"></asp:Label>
                                </div>
                                <div id="div1" style="display: none">
                                    <table style="width: 100%;">
                                        <tr>
                                            <td align="center" valign="middle">
                                                <img src="../images/loading7.gif" id="img1" alt="Loading" width="30" height="20" />
                                                <span id="Span1">Please wait...</span>
                                            </td>
                                        </tr>
                                        <tr align="right">
                                            <td>
                                                <a id="A1" href="javascript:StopSubmit();">Cancel</a>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="f_row">
                                    &nbsp;</div>
                                <div class="f_row">
                                    <asp:Label ID="Label2" Text="" Font-Size="12px" ForeColor="Green" Font-Bold="true"
                                        Font-Names="Arial" runat="server"></asp:Label>
                                </div>
                                <div class="f_row sr_button">
                                    <%--<asp:ImageButton ID="imgbtnLogin" runat="server" ImageUrl="~/images/buttons/proceed2.gif"
                                        OnClientClick="LoadValidationErrorCss();" ValidationGroup="userpassword" AlternateText="Sign in"
                                        ToolTip="Sign in" OnClick="imgbtnLogin_Click" />--%>
                                    <asp:Button runat="server" ID="btnExUserLogin" ValidationGroup="userpassword" CssClass="button_proceed"
                                        onmousedown="this.className = 'button_proceed_mousedown';" onmouseup="this.className = 'button_proceed';"
                                        onmouseout="this.className = 'button_proceed';" OnClientClick="LoadValidationErrorCss(); if (Page_ClientValidate('userpassword')){this.removeAttribute('onmouseout'); this.removeAttribute('onmouseup'); this.className='button_processing';}"
                                        OnClick="btnExUserLogin_Click" />
                                    <div style="display: none;">
                                        <input id="inputLoginCount" runat="server" value="0" /></div>
                                </div>
                            </div>
                        </div>
                        <div style="text-align: left; width: 100%;">
                            <asp:Button ID="btnPasswordClose" runat="server" Text="Close" Width="50px" OnClick="btnPasswordClose_Click"
                                OnClientClick="HidePopup();ShowHidePasswordPanel(true);" />
                        </div>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </asp:Panel>
    </div>
    </form>
    </span></span>
</asp:Content>
